package com.beten.demo;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.TextView;

public class CrashReportActivity extends Activity {
	
	public static final String EXTRA_STACKTRACE="com.tencent.stackTrace";
	
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.crash_report);
        
        findViewById(R.id.close).setOnClickListener(
        	new View.OnClickListener() {
        		public void onClick(View view) {
        			finish();
        		}
        	}
        );
        
        TextView stackTraceView=(TextView)findViewById(R.id.stackTrace);
        stackTraceView.setHorizontallyScrolling(true);
        stackTraceView.setMovementMethod(ScrollingMovementMethod.getInstance());
        stackTraceView.setClickable(false);
        stackTraceView.setLongClickable(false);
        
        String stackTrace=getIntent().getStringExtra(EXTRA_STACKTRACE);
        if (stackTrace!=null) {
        	stackTraceView.setText(stackTrace);
        }
    }	
    
	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		// TODO Auto-generated method stub
		if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
			// protrait

		} else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
			// land
		}

		super.onConfigurationChanged(newConfig);
	}

}
